package tp;

import javax.swing.SwingUtilities;

import tp.ui.menu.Accueil;
import tp.util.JDOSupport;

/**
 * Launcher. This creates and displays the MainFrame on the
 * EventDispatchThread.
 * It can be run in two modes depending on the supplied command line argument.
 *
 * <ol>
 * <li>(none): Connects directly to the database.
 * <li><code>remote_host</code>: Run against a Versant JDO Interface server on remote_host.
 * </ol>
 *
 * To test remote operation start a server in one console (ant run-server) and
 * then run the demo in remote mode from another console (ant run-remote).
 * If you want to connect from a different machine then edit the run-remote
 * task in build.xml to specify the host name as a argument.
 *
 */
public class MainGui implements Runnable {

    public static void main(String[] args) {
        try {
            JDOSupport.init(args.length > 0 ? args[0] : null);
            MainGui main = new MainGui();
            SwingUtilities.invokeAndWait(main);
            if (main.error != null) throw main.error;
        } catch (Throwable e) {
            e.printStackTrace(System.out);
            System.exit(1);
        }
    }

    private Throwable error;

    public void run() {
		new Accueil().selected();
    }

}

